package com.dimong.www.loan.ui.adapter.holder;


import android.content.Context;
import android.media.Image;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.dimong.loan.sdk.ui.adapter.BaseRecyclerViewHolder;
import com.dimong.loan.sdk.utils.GlideUtil;
import com.dimong.www.loan.R;
import com.dimong.www.loan.bean.CmsBean;

public class LoadStrategyHolder extends BaseRecyclerViewHolder {
    private ImageView item_load_strategy_pic;
    private TextView tv_load_strategy_title;
    private TextView tv_loan_strategy_time;
    private TextView tv_loan_strategy_click_num;
    public LoadStrategyHolder(Context context,ViewGroup parent) {
        super(context, R.layout.item_load_strategy, parent);

        item_load_strategy_pic = findViewById(R.id.item_load_strategy_pic);
        tv_load_strategy_title = findViewById(R.id.tv_load_strategy_title);
        tv_loan_strategy_time = findViewById(R.id.tv_loan_strategy_time);
        tv_loan_strategy_click_num = findViewById(R.id.tv_loan_strategy_click_num);
    }

    @Override
    public void setData(Object object) {
        super.setData(object);
        if(object instanceof CmsBean){
            CmsBean cmsBean = (CmsBean) object;
            tv_load_strategy_title.setText(cmsBean.getTitle());
            tv_loan_strategy_time.setText(cmsBean.getCreate_time());
            tv_loan_strategy_click_num.setText(cmsBean.getClick_num());
            GlideUtil.loadImg(mContext,cmsBean.getPic(),item_load_strategy_pic);
        }
    }
}
